<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="form-group" id="thumbnailUploadContainer" class="col-sm-10" style="float: left; margin-right: 50px;">
    <input id="articleImageFile" name="excelFile" type="file" class="form-control"  />
    <input id="saveZipButton" type="button" style="width: 60px;height: 35px;" onclick="f()" value="上传" />
</div>
<br><br>
<span id="jin">金：</span><br />
<span id="mu">木：</span><br />
<span id="shui">水：</span><br />
<span id="huo">火：</span><br />
<span id="tu">土：</span>
<form >

</form>
</body>
<script>
    function f (){
        var formData = new FormData();
        var name = $("#articleImageFile").val();
        formData.append("file",$("#articleImageFile")[0].files[0]);
        formData.append("name",name);//这个地方可以传递多个参数
        console.log(name);
        setInterval(data(formData,name),3000);
        //设置跨域请求
    }

    function data(formData,name){
    console.log(name);
        if(name != null){
            $.ajax({
                type:'post',
                url:'http://localhost:8000/exportt',
                //async:false,
                data:formData,
                processData: false,
                contentType: false,
                //dataType:'json',
                // 告诉jQuery不要去处理发送的数据
                //processData : false,
                // 告诉jQuery不要去设置Content-Type请求头
                //contentType : false,
                //beforeSend:function(){
                // console.log("正在进行，请稍候");
                // },
                success : function(b) {
                   // ;
                    //alert(s);
                    for (var key in b) {

                    }
                    console.log(b["土"]);
                    $('#jin').append('<lable>' +b["金"]+'</lable>');
                    $('#mu').append('<lable>' +b["木"]+'</lable>');
                    $('#shui').append('<lable>'+ b["水"]+'</lable>');
                    $('#huo').append('<lable>' +b["火"]+'</lable>');
                    $('#tu').append('<lable>' +b["土"]+'</lable>');
                }
            })
        }
    }
</script>
</html>